<template>
    <div>
        <div class="index1">
            <div class="w1">
                <div class="w1_1">
                    <img src="https://upload-bbs.mihoyo.com/upload/2022/03/30/d624c4f765eea648c0fc96e9291ddbb4_6432107776495365036.jpg?x-oss-process=image/resize,s_150/quality,q_80/auto-orient,0/interlace,1/format,jpg" alt="">
                </div>
                <div class="w1_2">
                    <span>层岩巨渊</span>
                    <span>擦擦你到底哦v你都i</span>
                </div>
            </div>
            <div class="w2">
                <div class="w2_1">
                    <p>关注</p>
                </div>
                <div class="release1">
                    <div class="release1_1" @click="Post_a_post">
                        <i class="el-icon-edit"></i>
                        <div>发布帖子</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="index2">
            <div class="index2_1">
                <span class="ti1" v-for="i in Sub_route" :key="i" :style="[{borderBottom: name===i?'3px solid #00c3ff':''},{color: name===i?'#00c3ff':''}]" @click="route(i)">{{i}}</span>
            </div>
            <div class="index3">
                <div class="w1">
                    <LatestP :the_data1="data_source1" :the_data2="data_source2"></LatestP>
                </div>
                <div class="w2">
                    <div class="w2_2">
                        <div class="w2_2_1">
                            <div class="uia1">
                                <img src="https://img-static.mihoyo.com/new_qrcode/qrcode_ys.png" width="100px" alt="">
                                <div class="uia1_1">
                                    <span class="ti1">扫码下载米游社App</span>
                                    <span class="ti2">了解提瓦特最新资讯</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import LatestP from '../components/Tavern routing/THot.vue'
export default {
    components: {LatestP},
    data() {
        return {
            name: '热门',
            Sub_route: ['最新', '热门', '精选'],
            data_source1: null, // 帖子数据
            data_source2: null, // 置顶数据
            // 置顶
            topping: [
                {id: 1, title: '置顶la', name: '【公告】米游社硬核讨论区版规'},
                {id: 1, title: '置顶la', name: '【公告】米游社硬核讨论区版规'},
            ],
            // 热门
            data1: [
                {
                    id: 1,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                },{
                    id: 2,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/b20891f66c723d6c569c1e8f3447671e.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                }
            ],
            // 最新回复
            data2: [
                {
                    id: 1,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                },{
                    id: 2,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/b20891f66c723d6c569c1e8f3447671e.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                }
            ],
            // 最新发帖
            data3: [
                {
                    id: 1,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/3fe57965ed348966dd93dfaba28da0f6.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/04/29/b20891f66c723d6c569c1e8f3447671e.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/05/02/8ffeba1c742e7ef9d38a14c944f39872.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                },{
                    id: 2,
                    img1: 'https://img-static.mihoyo.com/avatar/avatar10014.png',
                    icon: '../../assets/img/v.png',
                    name: '西风快报员',
                    grade: 'https://img-static.mihoyo.com/level/level16.png',
                    time: '22小时',
                    title: '[百货奇货]活动：开奇货匣得原石!',
                    brief: '常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f常年你的GIF不覅u是非哦分工日工日个穷鬼·iOS v hi发vi的比赛v覅u百度f',
                    listImg: [
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg',
                        'https://upload-bbs.mihoyo.com/upload/2022/03/30/5f1612a985b3c421e3298bc17618a43b.jpeg'
                    ],
                    label: ['你好uacdfssf','不好吧','太好啦'],
                    views: '168万+',
                    comment: '9800',
                    give: '16万+'
                }
            ],
        }
    },
    mounted() {
        this.First_pass()
    },
    methods: {
        First_pass() {
            this.data_source1 = this.data1
        },
        route(i) {
            this.name = i
            if(i === '最新') {
                // this.$router.push('/TLatest post')
                // this.pp = [{p: 11, n: 22}]
                this.data_source1 = this.data3
                this.data_source2 = this.topping
            }else if(i === '精选') {
                // this.$router.push('/TLatest reply')
                // this.pp = [{p: 99, n: 88}]
                this.data_source1 = this.data2
                this.data_source2 = this.topping
            }else if(i === '热门') {
                // this.$router.push('/THot')
                this.data_source1 = this.data1
                this.data_source2 = null
            }
        },
        Post_a_post() {
            this.$router.push('/post')
        }
    }
}
</script>

<style lang="less" scoped>
    .index1 {
        // border: 1px solid red;
        margin-top: 30px;
        background-color: white;
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border-radius: 10px;
        width: 1000px;
        .w1 {
            // border: 1px solid red;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            width: 100%;
            .w1_1 {
                img {
                    max-width: 80px;
                    border-radius: 10px;
                }
            }
            .w1_2 {
                margin-left: 10px;
                span {
                    display: flex;
                    flex-wrap: wrap;
                }
                span:nth-last-child(2) {
                    color: #666;
                }
                span:nth-last-child(1) {
                    color: #999;
                    font-size: 14px;
                }
            }
        }
        .w2 {
            // border: 1px solid red;
            width: 500px;
            display: flex;
            align-items: center;
            .w2_1 {
                display: flex;
                justify-content: center;
                align-items: center;
                border-radius: 10px;
                border: 1px solid #00c3ff;
                color: #00c3ff;
                height: 40px;
                width: 100px;
                cursor: pointer;
            }
            .release1 {
                // text-align: center;
                // border: 1px solid red;
                margin-left: 30px;
                .release1_1 {
                    // margin-top: 10px;
                    width: 100px;
                    background-color: #ffe14c;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    padding: 10px;
                    font-weight: bolder;
                    border-radius: 10px;
                    cursor: pointer;
                    i {
                        font-size: 20px;
                        padding-left: 10px;
                    }
                }
            }
        }
    }
    .index2 {
        .index2_1 {
            // border: 1px solid red;
            padding: 6px;
            margin-top: 30px;
            background-color: #fff;
            margin-left: 2px;
            height: 100%;
            width: 688px;
            display: flex;
            border-radius: 6px 6px 0px 0px;
            align-items: center;
            span {
                display: flex;
                align-items: center;
                height: 100%;
                margin-left: 10px;
                font-size: 19px;
                cursor: pointer;
            }
        }
        .index3 {
            display: flex;
            // margin-top: 30px;
            .w1 {
                width: 765px;
                margin-left: -30px;
            }
            .w2 {
                display: flex;
                justify-content: center;
                flex-wrap: wrap;
                width: 290px;
                height: 100%;
                .w2_2 {
                    background-color: white;
                    margin-top: -40px;
                    // margin-top: 20px;
                    // border: 1px solid red;
                    width: 95%;
                    height: 130px;
                    border-radius: 5px;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    flex-wrap: wrap;
                    cursor: pointer;
                    .w2_2_1 {
                        // border: 1px solid rgb(0, 0, 0);
                        width: 90%;
                        .uia1 {
                            display: flex;
                            align-items: center;
                            // border: 1px solid black;
                            .uia1_1 {
                                // border: 1px solid red;
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                flex-wrap: wrap;
                                font-size: 13px;
                                .ti1 {
                                    color: #00c3ff;
                                }
                                .ti2 {
                                    margin-top: 6px;
                                    color: #999;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
</style>